package org.jiangy.usercenter.repository;

import jakarta.validation.constraints.NotNull;
import org.jiangy.usercenter.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;

/**
 * <p>创建时间: 2024/8/14 </p>
 *
 * @author <a href="mailto:jiangliu0316@outlook.com" rel="nofollow">蒋勇</a>
 */
public interface UserRepository extends JpaRepository<User, Long> {
    User save(@NotNull User user);

    Optional<User> findById(@NotNull Long id);

    Optional<User> findByUsername(String username);
}
